import zipfile
f = zipfile.ZipFile('filename.zip', 'w' ,zipfile.ZIP_DEFLATED) 
f.write('1.txt') 
f.close() 
